package com.situ.mall.controller.front;

import java.util.List;

import javax.jws.WebParam.Mode;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;

import com.situ.mall.entity.Product;
import com.situ.mall.service.IProductService;

@Controller
@RequestMapping(value="/product")
public class ProductController {
	
	@Autowired
	private IProductService productService;
	
	@RequestMapping(value="/selectProductListPage")
	public String selectProductListPage(Integer categoryId, Model model) {
		//List<Product> list = productService.selectProductListByCategoryId(categoryId);
		//model.addAttribute("list", list);
		return "product_list";
	}
	
	
	@RequestMapping(value="/getProductDetailPage")
	public String getProductDetailPage(Integer productId, Model model) {
		Product product = productService.selectById(productId);
		model.addAttribute("product", product);
		return "product_detail";
	}
}
